NUM_EQ_BIN:
	PUSH(FP);
	MOV(FP,SP);

	CMP(IND(FPARG(0)),T_INTEGER);
	JUMP_EQ(NUM_EQ_BIN_1_INT);
	CMP(IND(FPARG(0)),T_FRACTION);
	JUMP_EQ(NUM_EQ_BIN_1_FRAC);
	JUMP(TYPE_ERROR);
NUM_EQ_BIN_1_INT:
	CMP(IND(FPARG(1)),T_INTEGER);
	JUMP_NE(NUM_EQ_BIN_1_INT_2_FRAC);
	CMP(INDD(FPARG(1),1),INDD(FPARG(0),1));
	JUMP_EQ(NUM_EQ_BIN_TRUE);
	JUMP(NUM_EQ_BIN_FALSE);
NUM_EQ_BIN_1_INT_2_FRAC:
	CMP(IND(FPARG(1)),T_FRACTION);
	JUMP_NE(TYPE_ERROR);
	PUSH(R1);
	MOV(R1,INDD(FPARG(1),1));
	REM(R1,INDD(FPARG(1),2));
	CMP(R1,0);
	JUMP_NE(NUM_EQ_BIN_FALSE);
	MOV(R1,INDD(FPARG(1),1));
	DIV(R1,INDD(FPARG(1),2));
	CMP(R1,INDD(FPARG(0),1));
	POP(R1);
	JUMP_NE(NUM_EQ_BIN_FALSE);
	JUMP(NUM_EQ_BIN_TRUE);

NUM_EQ_BIN_1_FRAC:
	CMP(IND(FPARG(1)),T_INTEGER);
	JUMP_NE(NUM_EQ_BIN_1_FRAC_2_FRAC);
	PUSH(R1);
	MOV(R1,INDD(FPARG(0),1));
	REM(R1,INDD(FPARG(0),2));
	CMP(R1,0);
	POP(R1);
	JUMP_NE(NUM_EQ_BIN_FALSE);
	PUSH(R1);
	MOV(R1,INDD(FPARG(0),1));
	DIV(R1,INDD(FPARG(0),2));
	CMP(R1,INDD(FPARG(1),1));
	POP(R1);
	JUMP_NE(NUM_EQ_BIN_FALSE);
	JUMP(NUM_EQ_BIN_TRUE);


NUM_EQ_BIN_1_FRAC_2_FRAC:
	CMP(IND(FPARG(1)),T_FRACTION);
	JUMP_NE(TYPE_ERROR);
	PUSH(R1);
	PUSH(R2);
	MOV(R1,INDD(FPARG(0),1));
	MUL(R1,INDD(FPARG(1),2));
	MOV(R2,INDD(FPARG(1),1));
	MUL(R2,INDD(FPARG(0),2));
	CMP(R1,R2);
	POP(R2);
	POP(R1);
	JUMP_NE(NUM_EQ_BIN_FALSE);
	JUMP(NUM_EQ_BIN_TRUE);

NUM_EQ_BIN_TRUE:

	MOV(R0,5);
	POP(FP);
	RETURN;

NUM_EQ_BIN_FALSE:

	MOV(R0,3);
	POP(FP);
	RETURN;



